﻿#pragma once

#include"Windows/Window.h"
#include"Events/ApplicationEvents.h"
#include"LayerStack.h"
#include"ImGui/ImGuiLayer.h"
#include"Renderer/Shader.h"
#include"Renderer/Buffer.h"
#include"Renderer/VertexArray.h"
#include"Renderer/OrthographicCamera.h"
#include"TimeStep.h"

#define APP Application::GetInstance()

namespace ArsEngine {

	class Application
	{
	public:
		static Application* GetInstance();
		void Run();
		void OnEvent(Event& e);

		void PushLayer(Layer* layer);
		void PushOverlayer(Layer* overlay);
		Window& GetWindow() { return *m_Window; }
		static void StartApp();
		void Initialize();

	private:
		Application();
		~Application();
		Application(const Application&) = delete;
		const Application& operator=(const Application&) = delete;

		bool OnWindowClose(WindowCloseEvent& event);

	private:
		bool m_Running = true;
		Scope<Window> m_Window;

		ImGuiLayer* m_ImGuiLayer;
		LayerStack m_LayerStack;

		float m_LastFrameTime = 0.0f;
	private:
		static Application* s_Instance;
	};


}
